#ifndef SEATDAO_H
#define SEATDAO_H

#include <QList>
#include <QSqlDatabase>
#include <QSqlError>
#include <QSqlQuery>
#include "seat.h"

class SeatDao
{
public:
    SeatDao();

private:
    QSqlQuery query;

public:
    int insert(Seat &defect);
    int updateByPrimay(Seat &defect);
    int deleteByPrimay(Seat &defect);
    int queryAll(QList<Seat *> &list);
    int queryRecent(QList<Seat *> &list, int toCount = 5);
    int querySeatBySeatNumber(QList<Seat *> &list,QString seatNumber);
};

#endif // SEATDAO_H
